'''
* This is the projet for Brtc LlmOps Platform
* @Author Leon-liao <liaosiliang@alltman.com>
* @Description //TODO 
* @File: 2_study_llm_runnable_lambda.py
* @Time: 2025/10/24
* @All Rights Reserve By Brtc
'''
import random

from langchain_core.runnables import RunnableLambda


def get_weather(location:str, unit:str, test:str)->str:
    """根据传入的位置 + 温度单位获取对应的天气信息"""
    print("location:", location)
    print("unit:", unit)

    return f"{location}天气为{random.randint(10, 40)}{unit}"

get_weather_runnable = RunnableLambda(get_weather).bind(unit="摄氏度", test="hello")
print(get_weather_runnable.invoke({"location":"长沙"}))
